Skip to content

[Backport 4.0.x] Switch default resolver transport from JDK/methanol to Apache HttpClient#12341

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
cherry-pick-12338-to-4.0.x
Jun 23, 2026
Merged

[Backport 4.0.x] Switch default resolver transport from JDK/methanol to Apache HttpClient#12341
gnodet merged 1 commit into
maven-4.0.xfrom
cherry-pick-12338-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Backport of #12338 to maven-4.0.x.

Cherry-pick of ffd7baa — conflict resolved in the IT test.

Summary

  • Remove maven-resolver-transport-jdk from the distribution, making Apache HttpClient the only bundled HTTP transport
  • The JDK HTTP transport (backed by methanol) has proven flaky on Windows CI with race conditions in the gzip/inflater code path (NullPointerException: Inflater has been closed)

Changes

  • apache-maven/pom.xml: removed maven-resolver-transport-jdk dependency from the distribution
  • impl/maven-cli/pom.xml: switched mvnup dependency from transport-jdk to transport-apache
  • AbstractUpgradeStrategy (mvnup): switched DI provider from JdkTransporterFactory to ApacheTransporterFactory
  • MavenITmng7470ResolverTransportTest: default transport test now expects ApacheTransporter; removed testResolverTransportJdk test; simplified version-detection helpers (kept backward compat for old HttpTransporter class name)

Conflict resolution

The IT test on maven-4.0.x has a version-range constructor super("[3.9.0,)") and backward-compat logic for the old HttpTransporter class name (pre-4.0.0-alpha-9). These were preserved. JDK-specific helpers (isJdkTransportUsable, isJdkTransportPresent) were replaced with a single isApacheTransportRenamed() method.

…ent (#12338)

* Switch default resolver transport from JDK/methanol to Apache HttpClient

The JDK HTTP transport (backed by methanol) has proven flaky on
Windows CI due to race conditions in the gzip/inflater code path.
Switch the default transport to Apache HttpClient for better stability
while keeping JDK transport available via -Dmaven.resolver.transport=jdk.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove JDK/methanol transport from the distribution bundle

Per review feedback: remove maven-resolver-transport-jdk from
apache-maven/pom.xml entirely so it is no longer shipped. Also
remove the testResolverTransportJdk integration test since the
JAR is no longer bundled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert unnecessary priority overrides — auto selection suffices

Since JDK transport is no longer bundled, the auto selection
naturally picks Apache as the highest-priority remaining transport.
No need to explicitly force priorities in the default case.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jun 23, 2026
@gnodet gnodet self-assigned this Jun 23, 2026
@gnodet gnodet merged commit 9958021 into maven-4.0.x Jun 23, 2026
24 checks passed
@gnodet gnodet deleted the cherry-pick-12338-to-4.0.x branch June 23, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant